package com.example.JcGQS.enums;

/**
 * 采购状态枚举类
 * @author 末日
 * @date 2023/11/21
 */
public enum PurchaseStateEnum {
    TO_BE_SUBMITTED("0","待提交"),
    REVIEWEDING("1","审核中"),
    ALLOWED("2","审核通过"),
    NOT_ALLOW("3","审核失败"),
    PURCHASING("4","采购中"),
    HAVE_ORDER("5","已下单"),
    PURCHASE_FAILURE("6","采购失败"),
    PURCHASE_SUCCESS("7","采购完成"),
    NOT_ALLOW_DELETE("8","审核失败并删除"),
    PURCHASE_FAILURE_DELETE("9","采购失败并删除"),
    ON_RETURN("10","退货中"),

    Regenerate("Regenerate","重新生成新数据"),
    NORegenerate("noRegenerate","不生成新数据");




    private String value;
    private String state;
    public String getValue() {
        return value;
    }
    /**
     * @return the state
     */
    public String getState() {
        return state;
    }
    PurchaseStateEnum( String value,String state) {
        this.value = value;
        this.state = state;
    }

    public static String getDescriptionByCode(String value) {
        for (PurchaseStateEnum status : PurchaseStateEnum.values()) {
            if (status.value.equals(value)) {
                return status.getState();
            }
        }
        return null; // 或者抛出异常，表示未找到对应的枚举值
    }
}
